import "package:flutter/material.dart";
import "package:get/get.dart";
import "package:osg/controllers/my_method.dart";

class AllMiddleware extends GetMiddleware {
  @override
  RouteSettings? redirect(String? route) {

  final token = Get.find<MyMethod>().myget('token');
  
    final parameters = Get.parameters;
    if (parameters['type'] == '1') {
    } else {

      if (token == null||token=='') {
        //  Get.offNamed('/login/login_type');
        print('zzzzzz1');

         return const RouteSettings(name: "/login/login_type", arguments: {});
      }
    }
    return null;

    // return const RouteSettings(name:"/login",arguments:{});//跳转到对应页面
  }
}
